import React, { Component, Suspense } from 'react';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import SiteAccess from './siteAccess';
import AppAccess from './appAccess';
import WxAccess from './wxAccess';
import { connect } from 'dva';
import Bottword from '@/modules/Bottword.js';
import PageLoading from '@/components/PageLoading';
import { FormattedMessage } from 'umi-plugin-react/locale';
import RobotBtn from '@/utils/robotBtn'
import { Row, Col, Radio, Card, Icon, Tooltip, Button } from 'antd';
import styles from './index.less'; // 测试

const ButtonGroup = Button.Group;
class accessSettings extends Component {
  state = {
    size: '1',
    pda:'',
  };

  componentDidMount() {
    const { dispatch } = this.props;
  }

  handleSizeChange = e => {
    this.setState({ size: e.target.value });
    console.log(e.target.value);
  };

  butta = () => {
    // console.log(val)
    this.setState({size:'1'})
  }

  buttb = () => {
    // console.log(val)
    this.setState({size:'2'})
  }

  render() {
    const { size } = this.state
    // console.log(pda)
    const a = {
      color:'#fff',
      background: '-webkit-linear-gradient(left, #0E73FF , #09ACFA)'
    }
    return (
      <div>
        <p style={{marginTop:10}} className={styles.titleA}>部署配置</p>
        <div className={styles.flexcen}>
          <div style={size==='1'?a:null} onClick={this.butta} className={styles.butta}>网站接入</div>
          <div style={size==='2'?a:null} onClick={this.buttb} className={styles.buttb}>APP接入</div>
        </div>
        <div className="homecard">
          <Card bordered={false} style={{padding: '14px'}}>
            <div  className={styles.dabj}>
              <div className={styles.backgroundp}>
                <Radio.Group value={this.state.size} onChange={this.handleSizeChange}>
                  {/* <Radio.Button value="1">网站接入</Radio.Button> */}
                  {/* <Radio.Button value="2">App接入</Radio.Button> */}
                  {/* <Radio.Button value="3">微信接入</Radio.Button> */}
                </Radio.Group>
                {/* <div style={{height:30}}></div> */}
                {size === '1' ? <SiteAccess /> : null}
                {size === '2' ? <AppAccess /> : null}
                {/* {this.state.size === '3' ? <WxAccess /> : null} */}
              </div>
            </div>

          </Card>
        </div>
      </div>
    );
  }
}

export default accessSettings;
